//
//  EOPlugin.m
//  CordovaDemo
//
//  Created by jiangyufeng on 2020/4/3.
//

#import "EOPlugin.h"
#import "AlertManager.h"
@implementation EOPlugin
- (void)myMethod:(CDVInvokedUrlCommand*)command
{
    NSLog(@"调用成功");
    CDVPluginResult* pluginResult = nil;
    NSString* myarg = [command.arguments objectAtIndex:0];
    if (myarg != nil) {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
    } else {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"Arg was null"];
    }
    
    AlertManager *alert = [[AlertManager alloc]init];
    UIViewController *rootController = [UIApplication sharedApplication].delegate.window.rootViewController;
    [alert showWithTitle:@"我是原生弹框" message:@"我是原生弹框" sure:@"确定" on:rootController sureBlock:^{
        
    }];
        

    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
@end
